package com.apes.scm.account.ledger.repository;

import com.apes.framework.jpa.repository.CustomRepository;
import com.apes.scm.account.ledger.model.LedgerEntry;

/**
 * @author xul
 * @create 2018-11-03 10:25
 */
public interface LedgerEntryRepository extends CustomRepository<LedgerEntry, String> {
//    @Query(value = "SELECT B.*"+
//            "        FROM ACC_lEDGER A,ACC_LEDGER_ENTRY B\n" +
//            "        WHERE A.ID=B.LEDGER_ID   AND A.COMPANY_ID = :COMPANY_ID\n" +
//            "        AND A.PARTNER_ID = :PARTNER_ID AND A.DEPT_ID = :DEPT_ID AND A.INVENTORY_MODE = :INVENTORY_MODE\n" +
//            "        AND A.ACCOUNTING_METHOD= :ACCOUNTING_METHOD AND A.LEDGER_ACCOUNT_ID = :LEDGER_ACCOUNT_ID\n" +
//            "        AND A.ACCOUNTING_DATE >= to_date(:ACCOUNTING_DATE_BEGIN,'yyyy-mm-dd')\n" +
//            "        AND A.ACCOUNTING_DATE >= to_date(:ACCOUNTING_DATE_END,'yyyy-mm-dd') + 1",
//            countQuery = "SELECT count(A.*) FROM ACC_lEDGER A,ACC_LEDGER_ENTRY B\n" +
//                    "        WHERE A.ID=B.LEDGER_ID   AND A.COMPANY_ID = :COMPANY_ID\n" +
//                    "        AND A.PARTNER_ID = :PARTNER_ID AND A.DEPT_ID = :DEPT_ID AND A.INVENTORY_MODE = :INVENTORY_MODE\n" +
//                    "        AND A.ACCOUNTING_METHOD= :ACCOUNTING_METHOD AND A.LEDGER_ACCOUNT_ID = :LEDGER_ACCOUNT_ID\n" +
//                    "        AND A.ACCOUNTING_DATE >= to_date(:ACCOUNTING_DATE_BEGIN,'yyyy-mm-dd')\n" +
//                    "        AND A.ACCOUNTING_DATE <= to_date(:ACCOUNTING_DATE_END,'yyyy-mm-dd') + 1",
//            nativeQuery = true)
//    Page<LedgerEntry> findLedgerEntryList(@Param("COMPANY_ID") String COMPANY_ID, @Param("PARTNER_ID") String PARTNER_ID, @Param("DEPT_ID") String DEPT_ID,
//             @Param("INVENTORY_MODE") String INVENTORY_MODE, @Param("ACCOUNTING_METHOD") String ACCOUNTING_METHOD,@Param("LEDGER_ACCOUNT_ID") String LEDGER_ACCOUNT_ID,
//                              @Param("ACCOUNTING_DATE_BEGIN") String ACCOUNTING_DATE_BEGIN,@Param("ACCOUNTING_DATE_BEGIN") String ACCOUNTING_DATE_END,Pageable pageable);
}
